package com.wx.day10.config;

import com.wx.day10.pojo.Interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 *
 *
 *  WebMvcConfigurer：springmvc框架配置类的特殊限制接口 -> 规定了mvc各种特别组件的配置方式 包含拦截器
 *
 */
@Configuration
public class InterceptConfig implements WebMvcConfigurer {

    @Autowired
    private Interceptor interceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(interceptor).
                addPathPatterns("/**").excludePathPatterns("拦截器对象").order(10);
    }
}
